package com.ftf.tp.blog.infrastructure.mapper.pos;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.ftf.tp.common.annotation.DocId;
import com.ftf.tp.common.annotation.EsClass;
import com.ftf.tp.common.annotation.EsField;
import com.ftf.tp.common.constants.EsDataType;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 标签表 es数据
 *
 * @author tanghao
 * @date 2021/11/12
 */
@Data
@EsClass(shards = 3, replicas = 2, index = "tag")
public class TagEsPO implements Serializable {

    /**
     * 主键
     */
    @DocId
    @JsonProperty(value = "_id", access = JsonProperty.Access.WRITE_ONLY)
    private Long id;

    /**
     * 标签名称
     */
    @EsField(name = "tag_name", type = EsDataType.TEXT, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    @JsonProperty("tag_name")
    private String tagName;

    /**
     * 标签状态
     */
    @EsField(name = "tag_status", type = EsDataType.INTEGER)
    @JsonProperty("tag_status")
    private Integer tagStatus;

    /**
     * 所属大类标签id (0 为大类标签)
     */
    @EsField(name = "tag_parent_id", type = EsDataType.LONG)
    @JsonProperty("tag_parent_id")
    private Long tagParentId;

    /**
     * 标签类型 (0:系统标签,1:用户自定义标签)
     */
    @EsField(name = "tag_type", type = EsDataType.INTEGER)
    @JsonProperty("tag_type")
    private Integer tagType;

    /**
     * 标签订阅数
     */
    @EsField(name = "follow_number", type = EsDataType.INTEGER)
    @JsonProperty("follow_number")
    private Integer followNumber;

    /**
     * 创建时间
     */
    @EsField(name = "created_time", type = EsDataType.DATE)
    @JsonProperty("created_time")
    private Date createdTime;

    /**
     * 创建人id(0 为系统创建)
     */
    @EsField(name = "created_by", type = EsDataType.LONG)
    @JsonProperty("created_by")
    private Long createdBy;

}
